<?php

class registro extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    // Inserta provisionalmente los datos del preregistro
    function insertar_usuario_prueba($email, $password, $username) {

        $error = 0;

        $this->db->trans_begin();
        try {
            $new_item = array(
                'email' => $email,
                'password' => $password,
                'username' => $username
            );

            // Se inserta el registro
            $this->db->insert('usuarios', $new_item);
        } catch (Exception $e) {
            $this->db->trans_rollback();
            log_message('debug', 'excepcion: ' . $e->getMessage());
        }
        $this->db->trans_commit();

        return $error;

    }

}

?>
